home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 24
/
Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso
/
Aminet
/
util
/
crypt
/
ThorPGP50.lha
/
PGP50AddToKeyRing.thor
next >
Wrap
Text File
|
1992-09-02
|
2KB
|
86 lines
/* $VER: PGPAddToKeyRing.thor 1.0 (14.01.98)
*
* Arexx script to add a PGP key to the public keyring. The key is taken
* from the current message in Thor.
*
* Main Script by: Eivind Nordseth, Ultima Thule Software.
* Adapted to PGP50 by: Kai Gunter Brandt, kgb@dataguard.no
*/
/* trace results */
options results
p = ' ' || address() || ' ' || show('P',,)
thorport = pos(' THOR.',p)
if thorport > 0 then thorport = word(substr(p,thorport+1),1)
else
do
say 'No THOR port found!'
exit 10
end
if ~show('p', 'BBSREAD') then do
address command
"run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
"WaitForPort BBSREAD"
end
filename = 't:pgptext'
address command
if exists(filename) then 'delete >nil:' filename
address(thorport)
SAVEMESSAGE CURRENT FILE filename NOHEADER
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"Not able to save current message."' BT '"_Ok"'
exit
end
address command 'search >nil:' filename '"BEGIN PGP PUBLIC KEY" QUICK QUIET'
if(rc = 5) then
do
REQUESTNOTIFY TEXT '"This message contains no PGP key."' BT '"_Ok"'
exit
end
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"Search failed. Check path."' BT '"_Ok"'
exit
end
GETGLOBALCONFIG CFG
if(rc ~= 0) then exit
address BBSREAD GETGLOBALDATA stem GLOBALDATA
if(rc ~= 0) then exit
Call Close 'STDOUT'
Call Close 'STDIN'
Call Open 'STDOUT','CON:0/13//150/PGPAmiga/SCREEN' || CFG.PUBSCREENNAME
Call Pragma '*','STDOUT'
Call Open 'STDIN','*'
if GLOBALDATA.PGPCommand = '' then
do
call getpath
pgpcommand = result
end
else pgpcommand = GLOBALDATA.PGPCOMMAND
address command "sys:c/pgpk -a "filename
if(rc ~= 0) then
do
REQUESTNOTIFY TEXT '"PGP failed. Check Global Config or PGPPATH envirorment variable."' BT '"_Ok"'
exit
end
if exists(filename) then address command 'delete >nil:' filename
exit 0